home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / printing / lw8_hosesample / pswritererr.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  18.4 KB  |  514 lines

  1. /*
  2.     File:        PSWriterErr.h
  3.  
  4.     Contains:    This file contains defines for the internal Errors
  5.                 the PostScript printer driver can generate.
  6.  
  7.     Written by: Richard Blanchard and Ingrid Kelly    
  8.  
  9.     Copyright:    Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 7/26/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. #pragma once
  25.  
  26. #ifndef __PSWRITERERR__         
  27. #define __PSWRITERERR__        
  28.  
  29. /*    The error values returned from components is a signed 32 bit value. The driver
  30.     uses OSErr everywhere which is a signed 16 bit value. The macro mapComponentErr()
  31.     looks at an error value and if it is out of range, then it maps the error to
  32.     'errGenericComponentErr'. For simplicity, this macro assumes errors are all
  33.     negaitive. rb580 bg035.
  34. */
  35. #define kMinOSErr    -32768
  36. #define mapComponentErr(cmErr)    ((cmErr) < kMinOSErr ? errGenericComponentErr : (OSErr)(cmErr))
  37.  
  38. enum{
  39.     // iPrAbort = 128,
  40.     
  41.     errNotAKey =                 -8998,
  42. //    errFaceListBad =             -8997,
  43. //    errSizeListBad =             -8996,
  44. //    errFontNotFound =             -8995,
  45. //    errUnknownPSLevel =         -8994,
  46.     errInLineTimeout =             -8993,
  47.     
  48. //    errNoProcSetRes =            -8991,
  49.     errBadSpoolFileVersion =     -8990,
  50.     errCouldNotMakeNumberedFilename =     -8989,
  51.     
  52. //    errPSFileName =             -8987,
  53.     errBitmapFontNotLoaded =     -8986,                
  54.     errDidNotDownloadFont =     -8985,
  55.     errBadConverterIndex =         -8984,
  56. //    errSpoolFolderIsAFile =        -8983,
  57. //    errPSFileNameNull =            -8982,
  58. //    errNullColorInfo =            -8981,
  59.     errNoPagesSpooled =         -8980,
  60. //    errBadConverterID =         -8979,
  61. //    errNoPattern =                 -8978,                
  62.     errPSStateUnderflow =        -8977,                
  63.     errChannelNotBinary =        -8976,                
  64.     errPrinterNotLevel2 =        -8975,                
  65.     errBadFontKeyType =            -8974,                
  66. //    errFunctionNotAvailable =    -8973,                
  67.     errNULLFormatString    =        -8972,                
  68.     errNotAFolderAlias =        -8971,                
  69.     errMissingPAPA =            -8970,                
  70. //    errMissingPrinterInfo =        -8969,                
  71.     errUnsupportedDestColorMode = -8968,            
  72. //    errUnknownColorUsage =        -8967,                
  73.  
  74.     errUnsupportedCodec =         -8966,                
  75.     errInvalidPPD =                -8965,                
  76.     errBadColorSync2Comment =     -8964,                
  77.     errBadFlattenRefCon =         -8963,                
  78.     errGlyphsDontFit =             -8962,                
  79.     errGenericComponentErr =     -8961,                
  80.     errUnsupportedStream =         -8960,                
  81.     errProfileNotInList =         -8959,                
  82.     errUninitializedPort =         -8958,            
  83.     errHintWrongSize =             -8957,                        
  84.     errSystemProfileNotFound =    -8956,                
  85.     errCFM_EnablerNotPresent =  -8955,                
  86.     errCouldNotIDArchitecture = -8954,                
  87.     errPSStreamNullOutProc =     -8953,                
  88.     errTriedToWriteNullBuffer = -8952,                
  89.     errWhoTookThatOutBuffer =     -8951,                
  90.     errMoreDataToFlush =        -8950,                
  91.     errWrongStructVersion =        -8949,                
  92.     errPortIsNull =                -8948,                
  93.     errLW8WrongArch =             -8947,                
  94.     errUnknown =                 -8946,                
  95.     errPrLibWrongArch =         -8945,                
  96.     errPrLibMissing =             -8944,                
  97.     errInvalidLibraryNumber =     -8943,                
  98.     errMissedTTFont =            -8942,                
  99.     errNoRoomInPapa =             -8941,                
  100.     errInvalidDTPType =         -8940,                
  101.     errBadLibraryVersion =         -8939,                
  102.     errRenderAtDeviceResl =     -8938,                
  103.     errInvalidExtendedPapa =     -8937,                
  104.     errInvalidPluginsCache =     -8936,                
  105.  
  106.     errInvalidPluginSubType =    -8934,                
  107.     errSecurityViolation    =     -8931,                    
  108.     errRequiresJava =            -8930,                
  109.     errRequiresThreads =         -8929,                
  110.     errRequiresAppearance =     -8928,                
  111.     
  112.     errHoseCantBeUsed    =         -8927,                
  113.     errHoseInUse        =         -8926,                
  114.     errHoseWrongState    =         -8925,                
  115.  
  116.     errSalamanderNotAvailable = -8924,                
  117.     errJavaFailure =            -8923,                
  118.  
  119.     errFatalPrinterErr =        -8919,            
  120.     errCouldNotMoveSpoolFile =     -8918,            
  121.     errTooLargeFont =            -8917,            
  122.  
  123.     errIrdaToolNotFoundErr = -8916,    
  124.     
  125.     errNoFontObject                = -8915,        
  126.     errNoFontEncoding            = -8914,        
  127.     errApplyEncoding            = -8913,
  128.         
  129.     errIrdaUnknownOpenErr         = -8912,        
  130.     errIrdaDisconnectedErr         = -8911,        
  131.  
  132.     errCantFGorBGPrint             = -8910,            
  133.     LPR_ResultErr                 = -8909,            
  134.         
  135.     errATSStreamInternal            = -8908,
  136.     errATSStreamNullFlatParam         = -8907,
  137.     errATSStreamParamErr            = -8906,
  138.     errATSStreamNoFontName            = -8905,
  139.     errATSStreamFontObject            = -8904,
  140.     errATSStreamAGFind                = -8903,
  141.     errATSStreamCorrupt                = -8902,
  142.     errATSStreamNoStrikeTransform    = -8901,
  143.     errATSStreamNoStrikeDesc        = -8900,
  144.     errATSStreamSysVersion            = -8899,
  145.     errATSStreamNoQuickTime            = -8898,
  146.     errATSStreamNoCompressionMgr    = -8897,
  147.     errATSStreamComponentReg        = -8896,
  148.  
  149.     errNoBuffersAvailable            = -8895,
  150.     errOutRangePageNumberErr        = -8894,        
  151.  
  152.     errPSNameTooBig                    = -8893,        
  153.     errSecurityIgnore                = -8892,        
  154.     errSecurityNoAuthErr            = -8891,            
  155.     errBadlyFormedBitmapFont        = -8890,        
  156.     errBadlyFormedFond                = -8889,        
  157.  
  158.     errUSBHoseOldClassDriver        = -8888,        
  159.  
  160.     errNeedPowerPC                    = -8887,        
  161.     errBadLPRDeviceOrAddress        = -8886,            
  162.     errNoLPRConnection                = -8885,            
  163.     errLPRConnectionError            = -8884,            
  164.     errUnableToDoNewIrdaConnection    = -8883,            
  165.     errNoSuchVolumeError            = -8882,            
  166.     errLaunchOutOfMem                = -8881,            
  167.     errClientHighLevelEvent            = -8880,            
  168.     errServerHighLevelEvent            = -8879,            
  169.     errUSBUnknownOpenErr            = -8878,            
  170.     errAppleTalkIsNotAvailableErr     = -8877,            
  171. /*    Old LaserWriter 7 errors.
  172. */
  173.     manualFeedTOErr =            -8132,
  174.     generalPSErr =                -8133,
  175.     noChoosenPrinterErr =        -8150,
  176.     prepMismatchErr =            -8151,
  177.     noPrepErr =                    -8152,
  178.     zoomRangeErr =                -8160,
  179.  
  180.     
  181. /*    Private error codes we can return to Nessie.
  182. */
  183.     errNessiePutJobOnHold =     -4200,            // Tell Nessie to put the job on hold. rb2012
  184.     errNessieStopQueue        =      -4201,
  185.     errNessieTryAgain        =      -4202,
  186.  
  187. /*    Here are PAP error codes. 
  188. */
  189.     PAPNoCCBs =                    -4096,           // No free CCB's available
  190.     PAPBadRefnum =                -4097,           // Bad connection refnum
  191.     PAPActive =                 -4098,           // Request already active
  192.     PAPTooBig =                 -4099,           // Write request too big
  193.     PAPConnClosed =             -4100,           // Connection just closed
  194.     PAPNoPrinter =                 -4101,           // Printer not found on open
  195.  
  196.     errUserSelectPPD =             127,            
  197.     errUserAbort =                 128                
  198. };
  199.  
  200. /********************    Error Descriptions *****************
  201. errCommCodePtr
  202.     The interface to the communications module needed to invoke a communications
  203.     function. The error occurred because the pointer to the communications code
  204.     was .
  205.  
  206. errNotAKey
  207.     While invoking a font we could not find a key for the desired font number
  208.     and style. The error occurred because the font tables got messed up.
  209.  
  210. errFaceListBad
  211.     We went looking for an entry in the face list that should be there but
  212.     we couldn't find it. See peek.c.
  213.  
  214. errSizeListBad
  215.     The size list contained an entry that could not be reconciled with the face
  216.     list. See fontHassle.c
  217.     
  218. errUnknownPICTVersion
  219.     When running our own PICT opcode parser we ran into an PICT version
  220.     we didn't recognize. See opcodeConvert.c
  221.  
  222. errUnknownPSLevel
  223.     When we queried for the PostScript level we received an answer we
  224.     weren't expecting. See query.c
  225.  
  226. errInLineTimeout
  227.     We got tired of waiting for a response from the printer. See formatIn.c
  228.  
  229. errNoSaveFileName
  230.     We tried to get the filename of the PostScript file we will create but
  231.     the driver didn't have the name. See pdef0.c or spoolFile.c
  232.     
  233. errNoProcSetRes
  234.     While generating the PostScript prolog we were unable to get the resource
  235.     describing the needed procedure sets. See header.c
  236.     
  237. errBadSpoolFileVersion
  238.     While foreground Printing we went to read the header of our spool file but
  239.     found that the version number in the header was bad. See pmSupervisor.c
  240.  
  241. errCouldNotMakeNumberedFilename
  242.     See spoolFile.c in numberedFilename(). We were trying to make a unique
  243.     filename by adding numbers to the back of a basename. We tried lots of
  244.     numbers but still couln't make a unique name.
  245.  
  246. errPSFileNameNull
  247.     See spoolFile.c. The flag was set indicating that we should save to disk but
  248.     the filename pointer was NULL.
  249.  
  250. errWhereIsSystemFolder
  251.     See download.c. If machinesSystemFolder() in machinInfo.c can't find the
  252.     system folder then we return this error.
  253.  
  254. errBitmapFontNotLoaded                            
  255.     We called FMSwapFont and the output record contained a fontHandle which was
  256.     a handled to a resource which is not loaded.
  257.  
  258. errDidNotDownloadFont
  259.     See download.c. This should not be a fatal error but should be caught by the
  260.     caller to download(). The error means that a PostScript outline could not
  261.     be found for a PostScript font and that we didn't have an 'sfnt' to work
  262.     with.
  263.     
  264. errBadConverterIndex
  265.     When saving to disk we look at the jobType in the print record. We couldn't
  266.     find a matching entry in ourt 'fSav' resource. See pmSupervisor.c
  267.  
  268. errNullColorInfo
  269.     The function getColor() was called with a NULL GetColorInfo handle. See GetColor.c
  270.  
  271. errNoPagesSpooled
  272.     The applioation made a PrOpenDoc call and a PrCloseDoc call with no PrOpenPage/PrClosePage
  273.     calls in between. 
  274.  
  275. errBadConverterID
  276.     The 'PDEF' we wanted to run as the converter doesn't exist.
  277.     See SavePSInterface.c
  278.  
  279. errNoPattern
  280.     We couldn't find or make a pixpat. See PSPattern.c 
  281.  
  282. errPSStateUnderflow
  283.     We tried to pop our top most gState. See PSClip.c
  284.     
  285. errChannelNotBinary
  286.     Application indicated that it will send binary data with PrGeneral call. After query,
  287.     it turns out that the channel is ascii.
  288.  
  289. errPrinterNotLevel2
  290.     Application indicated that it will use level 2 operators with PrGeneral call. After query,
  291.     it turns out that the printer is a level 1 printer.
  292.  
  293. errBadFontKeyType
  294.     We were trying to set a font and the corresponding font key was not of an expected type. 
  295.  
  296. errFunctionNotAvailable
  297.     We tried to call a callback function that had not been initialized. See
  298.     PSClip.h
  299.  
  300. errNULLFormatString
  301.     The format string passed to OutFormatVar() in FormatOut.c was NULL. This is
  302.     not a good thing.
  303.  
  304. errFontNotFound
  305.     A font query reply didn't match any fonts in list of ps names.
  306.  
  307. errNotAFolderAlias
  308.     We tried to track down a Print Monitor Document Folder alias but couldn't
  309.     because either there wasn't an alias or the alias lead to a file not
  310.     a folder. See SpoolFile.c trackDownPMFolder().
  311.     
  312. errMissingPAPA
  313.     We went looking for the driver's PAPA resource but we couldn't find it. This is very bad.
  314.     DMG589 Returning this error when psCreateDMJobCollection is called with a NULL PapaHandle.
  315.  
  316. errMissingPrinterInfo
  317.     The current printer does not have an entry in the printer database. On entry in the database
  318.     is required since it is there we hold the current print mode. 
  319.     
  320. errGlyphsDontFit
  321.     In FontUtilitiees.c, we were trying to output some TrueType glyph definitions into
  322.     64K PostScript strings but we were unable to get even one glyph to fit. The code
  323.     requires the glyphs to end on long word boundaries so failure to meet that condition
  324.     was most likely the problem. 
  325.  
  326. errProfileNotInList
  327.     In ColorSyncUtil.c, we tried to use/close a temporary profile that was not in
  328.     our list of temporary profiles. 
  329.  
  330. errUnsupportedStream
  331.     The PSStream type passed in to a given library call is not supported.
  332.  
  333. errHintWrongSize
  334.     One of the converter's hints was a different size than expected. 
  335.     
  336.     
  337. errSystemProfileNotFound
  338.     In JobHeader.c when trying to setup the color handling information playback, we
  339.     got a hint to tell us to use ColorSync color matching and the destination profile
  340.     hint was not found. When we went to use the system profile as the default for this case,
  341.     we couldn't get the System profile. At that point we are hosed.        
  342.  
  343.     
  344. errPSStreamNullOutProc
  345.     The converter call psConvOpenDoc was passed a PSPrintStream type PSStream,
  346.     but the function pointer for the output routine was NULL. 
  347.  
  348. errTriedToWriteNullBuffer
  349.     In PrStream.c, one of the routines tried to write a buffer that does not
  350.     exist. This should never happen.
  351.  
  352. errWhoTookThatOutBuffer
  353.     In PrStream, we tried to dequeue a write buffer, but it disappeared. The async
  354.     code should have been stopped and therefore shouldn't have take the buffer.
  355.  
  356. errMoreDataToFlush
  357.     When the converter tells the client to flush its buffers, the client is
  358.     expected to return quickly. The client returns this error if it did not
  359.     finish flushing. The converter will then call the flush routine again. rb852
  360.  
  361. errWrongStructVersion
  362.     A caller to one of the externally visable API's (NessieInfoLib is an example)
  363.     passed in a version of a structure that is not compatable with the current
  364.     version of the code.
  365.     
  366. errInvalidLibraryNumber
  367.     A caller of the function getLibraryVersion supplied an invalid library number.
  368.     
  369. errMissedTTFont
  370.     We were about to make a bitmap font for the printer, but came across an 'sfnt'
  371.     resource. This means that we misclassified a TrueType font. See DumpBMFont.c
  372.     rb1008
  373.  
  374. errNoRoomInPapa
  375.     In Papa.c, we tried to add a tag to an extended papa and there was not enough room
  376.     for it. 
  377.  
  378. errInvalidDTPType
  379.     Returned from psGetDTPType, this error code indicates that the PAPA described an
  380.     invalid/unrecognized desktop printer type. 
  381.     
  382. errBadLibraryVersion    
  383.     The library version available doesn't contain the routines we need so we can't use it.
  384.     Initially this is because we now rely on the streams code availability in PSUtilsLib
  385.     but there will be other reasons in the future.    
  386.     
  387. errCantFGorBGPrint
  388.     Certain jobs require that the printing app can accept high level events or that we are
  389.     printing background to Nessie.  If neither is available we will return this error.    
  390.  
  391. errInvalidPluginSubType
  392.     Returned by the Plug-ins Manager if it the requested subtype is of an invalid subtype.
  393.     The only invalid subtype is that it uses internally to cache the information
  394.     about what libraries support a given type.
  395.  
  396. errInvalidExtendedPapa
  397.     In PAPA.c, we wanted to walk the tags in an extended PAPA, but the extended PAPA
  398.     looked bad.
  399.     
  400. errInvalidPluginsCache
  401.     Even though we validated the plugin's cache before beginning to use it, we got an error
  402.     that indicated the cache was not valid.
  403.     
  404. errInvalidDownloaderInfo
  405.     A Download Manager client passed us a DownloadInfo structure that is no longer valid. The way
  406.     this might occur is if it took one we returned and stored it away for later use. If in the meantime
  407.     the user has moved plugins out of the plugins folder or replaced PrintingLib with a different version
  408.     and    the DownloadInfo structure passed references a modified or non-existent file, then this error
  409.     is returned.
  410.  
  411. errCantMakeStreamForDTP
  412.     A Download Manager client passed a PAPA resource to psDownloadFile for a DTP type that we don't know how to 
  413.     support. If the same PAPA is passed to psCanDownloadFile we will say we can't download the file. This
  414.     scenario is unlikely to happen, but it can happen if the DM client calls psCanDownloadFile with one PAPA
  415.     and then calls psDownloadFile with another. This would happen if, for example, Nessie failed to again
  416.     call psCanDownloadFile if a 'spool' file intended for the Download Manager were dragged from one DTP
  417.     to another.
  418.  
  419. errRequiresJava
  420.     The routine called requires JManager, but it was not available.
  421.     This error is returned from ppdWebSearchDlg() and ppdWebSearch(). 
  422.     
  423. errRequiresThread
  424.     The routine called requires the Thread Manager which was not available.
  425.     This error is returned from ppdWebSearchDlg() and ppdWebSearch(). 
  426.     
  427. errRequiresAppearance
  428.     The routine called requires the Appearance Manager which was not available.
  429.     This error is returned from ppdWebSearchDlg().
  430.     
  431. errHoseCantBeUsed
  432.     A hose returns this error on the open call if it cannot be used. The initial use of this error 
  433.     is for the Open Transport PAP hose -- it's returned if OT is not installed or doesn't meet the 
  434.     version requirement.
  435.  
  436. errSalamanderNotAvailable
  437.     A comm channel was chosen that required the Salamander library but it isn't available. This should
  438.     only happen with our own internal builds but to be safe I'm adding an error code.
  439.  
  440. errJavaFailure
  441.     We were unable to use the Java VMN even though it was available. This error will occur
  442.     if we can't get a session or if one of the java.* classes that should be available
  443.     is not. See WebPPD.h
  444.     
  445. errBadParsePPD
  446.     The psAutoSetup routine in the NessieInfoLib was asked to setup the PPD but the PPD that was
  447.     selected had a parsing error. The Generic PPD is substituted.
  448.  
  449. errNeedsManualConfig
  450.     The psAutoSetup routine could not complete the setup because either there are installable options
  451.     for which there are no queries or the installable options query failed.    
  452.     
  453. errDTPNotFound
  454.     This error is returned from the function psNessieFindDTP() if it
  455.     was unable to find a DTP that matched the specified driver and PAPA.    
  456.  
  457. errFatalPrinterErr
  458.     This error is used when there is a fatal printer error reported by the printer but it
  459.     is not a PostScript error. I'm not sure when this occurs other than for serious printer bugs.
  460.     
  461. errCouldNotMoveSpoolFile
  462.     Returned in PrDraft.c this error occurs if we spooled into the temp file of a volume
  463.     that was different than the eventual destination of the spool file. This can only
  464.     happen if a DTP not on the boot volume is deleted between the time a spool job
  465.     is started and it is finished.
  466.  
  467. errNoFontObject
  468.     We did not convert StdText calls to ATSUI format because we either could
  469.     not get a FontObject or a font scaler for the requested font and face.
  470.     This is not a fatal error, it just prevents us from doing partial fonts
  471.     for that font. See StdTextToATS.c 
  472.  
  473. errNoFontEncoding
  474.     We could not find the proper encoding for a font when trying to convert StdText
  475.     to ATSUI. This is not a fatal error. See StdTextATS.c 
  476.  
  477. errApplyEncoding
  478.     We could not convert StdText character codes into glyph codes while converting
  479.     StdText to ATSUI text. This is not a fatal error. See StdTextAts.c rb2178
  480.  
  481. errPSNameTooBig
  482.     The PostScript name returned by OFA was larger than we were capable of using.
  483.     See getFontObjPSName() in FontHassle.c.  
  484.     
  485. errBadlyFormedBitmapFont
  486.     We detected that the bitmap font data had a first character value or last character
  487.     value that was out of range.    
  488.     
  489. errBadlyFormedFond
  490.     We detected a FOND that had a first character value or last character value that
  491.     was out of range.        
  492.  
  493. errUSBHoseOldClassDriver
  494.     The USB hose returns this error when the underlying USB printer class driver is too old.
  495.     This is an issue because of bugs in it with releases 1.0 & 1.1 (hopefully fixed in 1.2).
  496.  
  497. errNeedPowerPC    
  498.     8.6.5 requires power pc architecture. 
  499.  
  500. errBadLPRDeviceOrAddress                
  501.     
  502. errNoLPRConnection                    
  503. Timeout error trying to connect to LPR device.            
  504.  
  505. errLPRConnectionError                
  506. Error when connecting to LPR printer.  Likely cause is a misconfigured or inactive tcp/ip service.
  507.  
  508. errUnableToDoNewIrdaConnection                
  509. Error when connecting to IR device.
  510.  
  511. *********************/
  512.  
  513. #endif        // __PSWRITERERR__ 
  514.